<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div th:include="front/common/cssjs :: main"></div>

    <div th:include="front/common/header :: main"></div>

    <div class="container">

        <div class="mt-3">
            <h3 class="text-center">商品列表</h3>
            <table class="table table-bordered">
                <tr><th>ID</th><th>商品名</th><th>价格</th><th>操作</th></tr>
                <tr th:each="one:${PRODUCTS}">
                    <td th:text="${one.id}"></td> <td th:text="${one.name}"></td> <td th:text="${one.price}"></td>
                    <td><a th:href="@{'/cart/product/buy?id=' + ${one.id}}" class="btn btn-success btn-sm">购买</a>
                        <a th:href="@{'/cart/product/add?id=' + ${one.id}}" class="btn btn-success btn-sm">
                            <i class="fa fa-shopping-cart fa-lg"></i> 加入购物车</a></td>
                </tr>
            </table>
        </div>
    </div>
</body>
</html>